Page({
  data:{
    square:[
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01afFNgN20xZq2ZkPgY_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i1/4161056916/O1CN01qe5trH20xZppwOLC1_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01afFNgN20xZq2ZkPgY_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01NpLsGk20xZppwOfzH_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN017lOzWb20xZq45OPDb_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01afFNgN20xZq2ZkPgY_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01afFNgN20xZq2ZkPgY_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i1/4161056916/O1CN01qe5trH20xZppwOLC1_!!4161056916.png",
        width:187,
        height:174
      },
      {
        img:"https://img.alicdn.com/imgextra/i4/4161056916/O1CN01afFNgN20xZq2ZkPgY_!!4161056916.png",
        width:187,
        height:174
      }
      
    ],

    prizeNum:{
      num:2,
      name:"90优惠券",
      squareIndex:5     //squareIndex 下标
    },

    squareIndex:[0,1,2,5,8,7,6,3],
    turnsNum:3,   //转多少圈****
    speed:80

  },
  onLoad(query) {
    // 页面加载
    console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
  },

  onStart() { 

    // 测试数据
    let dataArr=[
      {
        num:2,
        name:"90优惠券",
        squareIndex:1     //squareIndex 下标
      },
      {
        num:2,
        name:"90优惠券",
        squareIndex:5     //squareIndex 下标
      },
      {
        num:2,
        name:"30优惠券",
        squareIndex:7     //squareIndex 下标
      }
    ]
    

    this.setData({
      prizeNum:dataArr[Math.floor(Math.random()*dataArr.length)]
    })

    console.log(this.data.prizeNum);
    
  },

  onReady() {
    // 页面加载完成
  },
  onShow() {
    // 页面显示
  },
  onHide() {
    // 页面隐藏
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息
    return {
      title: 'My App',
      desc: 'My App description',
      path: 'pages/index/index',
    };
  },
});
